//
//  ForwardWeiboViewController.m
//  WDFans
//
//  Created by test test on 4/17/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ForwardWeiboViewController.h"

NSString *kPostWeiBoNotification = @"kPostWeiBoNotification";

@implementation ForwardWeiboViewController;

@synthesize weiboTextView;
@synthesize weiboText;

#pragma mark - AbstractTabViewController methods
- (IBAction)leftItemClicked
{
    //must be implemented in subclass
    [self dismissModalViewControllerAnimated:YES];
}
- (IBAction)rightItemClicked
{
    //must be implemented in subclass
    NSDictionary *dict = [NSDictionary dictionaryWithObject:self.weiboTextView.text forKey:@"text"];
    [[NSNotificationCenter defaultCenter] postNotificationName:kPostWeiBoNotification object:nil userInfo:dict];
}

#pragma mark - View lifecycle

- (void)dealloc
{
    [weiboText release];
    [weiboTextView release];
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"分享到新浪微博";
    [self addNaviBarLeftItemWithTitle:@"取消"];
    [self addNaviBarRightItemWithTitle:@"发送"];
    self.weiboTextView.text = self.weiboText;
    [self.weiboTextView becomeFirstResponder];
    self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.weiboTextView = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
